package com.bj.dljd.convent;

import com.bj.dljd.domain.PayProduct;
import com.bj.dljd.domain.PayWay;
import com.bj.dljd.models.vo.PayProductQueryVo;
import com.bj.dljd.models.vo.PayProductVo;
import com.bj.dljd.models.vo.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,
uses = {CommonFun.class})
public interface PaymentConvert {


    List<PayProductQueryVo> convertListPayProductQueryVo(List<PayProduct> payWayList);
    List<PayWayVo> convertListPayWayVo(List<PayWay> payWayList);

    List<PayProductVo> convertListPayProductVo(List<PayProduct> productList);


    @Mappings({
            @Mapping(source = "editTime", target = "editTime",dateFormat = "yyyy-MM-dd HH:mm:ss")
            ,@Mapping(source = "status", target = "status",qualifiedByName = "convertStatus")
    })
    PayProductVo mapPayProductVo(PayProduct payProductVo);

    @Mappings({
            @Mapping(source = "editTime", target = "editTime",dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "status", target = "status",qualifiedByName = "convertStatus"),
            @Mapping(source = "payProductCode",target = "productCode")
    })
    PayWayVo payWayVo(PayWay payWay);


    PayProductQueryVo payProductQueryVo(PayProduct payProduct);
}
